package com.guguskins.back.controller;


import com.guguskins.back.entity.GuRollImage;
import com.guguskins.back.entity.vo.ResultVo;
import com.guguskins.back.service.GuRollImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * roll房的背景图 前端控制器
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-08-02
 */
@RestController
@RequestMapping("/guRollImage")
public class GuRollImageController {
    @Autowired
    GuRollImageService rollImageService;
    @GetMapping("list")
    public ResultVo list(){

        return ResultVo.success(rollImageService.list());
    }
    @GetMapping("back/list")
    public ResultVo backList(){

        return ResultVo.success(rollImageService.list());
    }
    @PostMapping("back/update")
    public ResultVo backUpdate(@RequestBody GuRollImage rollImage)
    {
        rollImageService.updateById(rollImage);
        return ResultVo.success("修改成功");
    }
    @PostMapping("back/insert")
    public ResultVo backInsert(@RequestBody GuRollImage rollImage){
        rollImageService.save(rollImage);
        return ResultVo.success("添加成功");
    }
    @GetMapping("back/remove")
    public ResultVo backRemove(Integer id){
        rollImageService.removeById(id);
        return ResultVo.success("删除成功");
    }
}
